/**
 * 消息接口
 */
import {
  HTTP
} from '../utils/http.js';
import utils from '../utils/util';

class messageModel extends HTTP {
  // 查询消息列表
  messageListPage(data, sCallback) {
    this.request({
      url: 'supplier/app/message/listPage',
      method: 'get',
      data: data,
      success: (res) => {
        if(res.code == 200){
          sCallback(res)
        }else{
          utils.msg(res.msg)
        }
      }
    })
  }

  // 查询消息详情
  messageFindById(data, sCallback) {
    this.request({
      url: 'supplier/app/message/findById',
      method: 'get',
      data: data,
      success: (res) => {
        if(res.code == 200){
          sCallback(res)
        }else{
          utils.msg(res.msg)
        }
      }
    })
  }

  // 查询读取消息
  messageRead(data, sCallback) {
    this.request({
      url: 'supplier/app/message/read',
      method: 'post',
      data: data,
      success: (res) => {
        if(res.code == 200){
          sCallback(res)
        }else{
          utils.msg(res.msg)
        }
      }
    })
  }
}
export {
  messageModel
}